﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Animation;

namespace GameApplication
{
    /// <summary>
    ///     Логика взаимодействия для StartPage.xaml
    /// </summary>
    public partial class StartPage : Page
    {
        private ThicknessAnimation ShowRight;
        private ThicknessAnimation ShowRect;

        public StartPage()
        {
            InitializeComponent();
            Startup_anim();
        }

        public void Startup_anim()
        {
            ShowRight = new ThicknessAnimation();
            ShowRight.To = new Thickness(0, 0, 0, 0);
            ShowRight.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 1000));
            btnSP.BeginAnimation(MarginProperty, ShowRight);
            btnTP.BeginAnimation(MarginProperty, ShowRight);
            btnFP3.BeginAnimation(MarginProperty, ShowRight);
        }

        private void btnFP3_Click(object sender, RoutedEventArgs e)
        {
            if (NavigationService != null)
                NavigationService.Navigate(new Uri("TestLocation.xaml", UriKind.Relative));
        }

        private void btnExit_Click(object sender, RoutedEventArgs e)
        {
        }

        private void Page_SizeChanged_1(object sender, SizeChangedEventArgs e)
        {
        }

        private void btnFP3_MouseEnter(object sender, MouseEventArgs e)
        {
            ShowRect = new ThicknessAnimation();
            ShowRect.To = new Thickness(0, 0, 0, 0);
            ShowRect.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 100));
            Rectshow.BeginAnimation(MarginProperty, ShowRect);
        }

        private void btnSP_MouseEnter(object sender, MouseEventArgs e)
        {
            ShowRect = new ThicknessAnimation();
            ShowRect.To = new Thickness(0, btnFP3.ActualHeight, 0, 0);
            ShowRect.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 100));
            Rectshow.BeginAnimation(MarginProperty, ShowRect);
        }

        private void btnTP_MouseEnter(object sender, MouseEventArgs e)
        {
            ShowRect = new ThicknessAnimation();
            ShowRect.To = new Thickness(0, btnTP.ActualHeight + btnFP3.ActualHeight, 0, 0);
            ShowRect.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 100));
            Rectshow.BeginAnimation(MarginProperty, ShowRect);
        }

        private void btnTP_Click(object sender, RoutedEventArgs e)
        {
            if (NavigationService != null)
                NavigationService.Navigate(new Uri("Demo.xaml", UriKind.Relative));
        }
    }
}